﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EvoSim.RandomNumberGenerators
{
    public class UniformRandomGenerator : IRandomGenerator
    {
        // Yes, it'i ironic we have to seed our random generator with a random number
        private MersenneTwister _rGen = new MersenneTwister((uint)new Random().Next());

        public int Next()
        {
            return _rGen.Next();
        }

        public double NextDouble()
        {
            return _rGen.NextDouble();
        }

		public double NextDouble(double min, double max)
		{
			return min + (max - min) * _rGen.NextDouble();
		}

        public int Next(int max)
        {
            return _rGen.Next(max);
        }

        public int Next(int min, int max)
        {
            return _rGen.Next(min, max);
        }
    }
}
